#ifndef wu_KINECT_H
#define wu_KINECT_H

#pragma once
#include "ofMain.h"
#include "ofxOpenNI.h"
#include "wuImagePlus.h"
#include "wuSkelstruct.h"


class wuKinect
{
    public:
        wuKinect();
        ~wuKinect();

		void setup(bool _bSkel=true, bool _bDepthRange=false);
        virtual void update();
		virtual bool skeletonDetected();
		void draw(bool bDrawlines=false);
		Skeleton getSkeleton();
		unsigned char * getPixelsUsers();
		unsigned char * getPixelsImage();
		unsigned char * getPixelsUsersImage();
		unsigned char * getPixelsDepthMask();
		unsigned char * getPixelsDepthMaskOver();

		void setFarThreshold(int _farThreshold);
		void setNearThreshold(int _nearThreshold);
        void setSkel(bool _bSkel);
		void	setupRecording();

		// kinect generators
		ofxOpenNIContext	recordContext;
		ofxDepthGenerator	recordDepth;
		ofxImageGenerator	recordImage;
		ofxUserGenerator	recordUser;

        // ofImage skin
        wuImagePlus skin;
		ofImage	allUserMasks, user1Mask, user2Mask, depthRangeMask, depthRangeMaskOver;

		Skeleton skel;
		bool bDepthRange, bSkel;
		int 	nearThreshold, farThreshold;

};
#endif

